Skip to content

Forward autoincrement property from field to column#674

Merged
collerek merged 9 commits intoormar-orm:masterfrom
smuething:fix_autoincrement_columns
Apr 20, 2026
Merged

Forward autoincrement property from field to column#674
collerek merged 9 commits intoormar-orm:masterfrom
smuething:fix_autoincrement_columns

Conversation

@smuething
Copy link
Copy Markdown
Contributor

The autoincrement property of ormar fields does not get propagated to the SQLAlchemy column definition. As a result, the autoincrement property of the SQLAlchemy column defaults to auto, making it impossible to create DDL that does not auto-increment the database column.

With this small patch, it becomes possible to create a table with a manually managed, integer-based PK.

smuething and others added 4 commits May 26, 2022 14:03
The autoincrement property of ormar fields did not get propagated to the SQLAlchemy column definition. As a result, the autoincrement property of the SQLAlchemy column defaulted to `auto`, making it impossible to create DDL that did not auto-increment the database column.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 23, 2024

CodSpeed Performance Report

Merging #674 will not alter performance

Comparing smuething:fix_autoincrement_columns (0c0c59b) with master (0014c46)

Summary

✅ 84 untouched benchmarks

collerek added 4 commits May 26, 2024 21:02
Verifies that autoincrement=False on an Integer primary key field is
forwarded to the underlying SQLAlchemy column.
Aligns the fmt target with master's tooling so contributors do not need
black installed locally.
@collerek collerek merged commit f57f858 into ormar-orm:master Apr 20, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants